import axios from 'axios'
import * as types from '~/store/types'

// axios.defaults.baseURL = 'http://127.0.0.1:4000/mock/';
// axios.defaults.baseURL = 'http://10.0.1.115:8888/autoreport/select'; //王维
// axios.defaults.baseURL = 'http://10.0.1.187:8080/autoreport/select';

const actions = {
  [types.HOME_PAGE] ({commit},options) {  //封面首页
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    console.log("~~~~~~~~~~",url,"~~~~")
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.HOME_PAGE, res.data.data )
        }
      })
  },
  [types.COOPERATION_TIMELINE] ({commit},options) {  //合作时间轴
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    console.log('数据请求地址：' + url)
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.COOPERATION_TIMELINE, res.data.data )
        }
      })
  },
  [types.STANDING_BOOK] ({commit},options) {  //台账使用时间分布情况
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.STANDING_BOOK, res.data.data )
        }
      })
  },
  [types.STANDING_BOOK_DISTRIBUTE] ({commit},options) {  //台账分布情况
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.STANDING_BOOK_DISTRIBUTE, res.data.data )
        }
      })
  },
  [types.RULE_PROCESS] ({commit},options) {  //盘点规则及流程
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.RULE_PROCESS, res.data.data )
        }
      })
  },
  [types.CLASSIFY_BOOK] ({commit},options) {  //分类对账情况
    // let url = 'http://127.0.0.1:4000/mock/classify_book';
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.CLASSIFY_BOOK, res.data.data )
        }
      })
  },
  [types.CHECKACCOUNT_ADMINOFFICE] ({commit},options) { // 对账情况-各科室
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.CHECKACCOUNT_ADMINOFFICE, res.data.data )
        }
      })
  },
  [types.CHECKACCOUNT_AGELIMIT] ({commit},options) { // 对账情况-使用年限
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.CHECKACCOUNT_AGELIMIT, res.data.data )
        }
      })
  },
  [types.STANDINGBOOK_FINKDISK] ({commit},options) { // 台账情况-医信精盘
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.STANDINGBOOK_FINKDISK, res.data.data )
        }
      })
  },
  [types.CHECK_ACCOUNT] ({commit},options) { // 对账情况
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.CHECK_ACCOUNT, res.data.data )
        }
      })
  },

  //第二章：云账数据分析
  [types.CLOUD_BOOK_DISTRIBUTE] ({commit},options) { //云账情况
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.CLOUD_BOOK_DISTRIBUTE, res.data.data )
        }
      })
  },
  [types.ADMINOFFICE_DEVICENUM] ({commit},options) { //科室多维分析-设备数量
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.ADMINOFFICE_DEVICENUM, res.data.data )
        }
      })
  },
  [types.KEY_EQUIPMENT_USE_ANALYSIS] ({commit},options) { //重点设备使用情况分析
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.KEY_EQUIPMENT_USE_ANALYSIS, res.data.data )
        }
      })
  },
  [types.KEY_EQUIPMENT_SERVICE_ANALYSIS] ({commit},options) { //重点设备超期服役分析
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.KEY_EQUIPMENT_SERVICE_ANALYSIS, res.data.data )
        }
      })
  },
  [types.ADMINOFFICE_BRAND] ({commit},options) { //科室多维分析-品牌
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.ADMINOFFICE_BRAND, res.data.data )
        }
      })
  },
  [types.ADMINOFFICE_CATEGORY] ({commit},options) { //科室多维分析-品类
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.ADMINOFFICE_CATEGORY, res.data.data )
        }
      })
  },
  [types.CATEGORY_ANALYSIS] ({commit},options) { //医疗设备品类分析
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.CATEGORY_ANALYSIS, res.data.data )
        }
      })
  },

  [types.ADMINOFFICE_OVERTIME_DEVICE] ({commit},options) { //科室多维分析-超时设备
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.ADMINOFFICE_OVERTIME_DEVICE, res.data.data )
        }
      })
  },
  [types.KEYNOTEDEVICE_DISTRIBUTE] ({commit},options) { //重点设备分析-分布情况
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.KEYNOTEDEVICE_DISTRIBUTE, res.data.data )
        }
      })
  },
  [types.LIFEDEVICE_DISTRIBUTE] ({commit},options) { //生命设备分析-分布情况
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.LIFEDEVICE_DISTRIBUTE, res.data.data )
        }
      })
  },
  [types.DEVICE_VALUE] ({commit},options) { //设备价值分析
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.DEVICE_VALUE, res.data.data )
        }
      })
  },
  [types.KEY_EQUIPMENT_BRAND_ANALYSIS] ({commit},options) { //重点品牌分析
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.KEY_EQUIPMENT_BRAND_ANALYSIS, res.data.data )
        }
      })
  },

  [types.USETIME_ANALYSE] ({commit},options) { //使用时长分析
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.USETIME_ANALYSE, res.data.data )
        }
      })
  },
  [types.ADMINOFFICE_USEAGE] ({commit},options) { //科室多维分析-使用年限分析
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.ADMINOFFICE_USEAGE, res.data.data )
        }
      })
  },
  [types.ADMINOFFICE_DEVICEVALUE] ({commit},options) { //科室多维分析-价值分析
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.ADMINOFFICE_DEVICEVALUE, res.data.data )
        }
      })
  },
  [types.KEYNOTEDEVICE_USEAGE] ({commit},options) { //重点设备-使用年限分析
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.KEYNOTEDEVICE_USEAGE, res.data.data )
        }
      })
  },
  [types.LIFEDEVICE_BRAND_ANALYSIS] ({commit},options) { //生命支持类设备分析-品牌分析
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.LIFEDEVICE_BRAND_ANALYSIS, res.data.data )
        }
      })
  },



  //第三章: 盘盈与盘亏数据分析
  [types.PROFIT_DEVICE_VALUE] ({commit},options) { //盘盈分析-设备价值
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.PROFIT_DEVICE_VALUE, res.data.data )
        }
      })
  },
  [types.PROFIT_MEDICINE_DEVICE] ({commit},options) { //盘盈分析-医疗设备
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.PROFIT_MEDICINE_DEVICE, res.data.data )
        }
      })
  },
  [types.LOSSES_DEVICE_VALUE] ({commit},options) { //盘亏分析-设备价值
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.LOSSES_DEVICE_VALUE, res.data.data )
        }
      })
  },
  [types.LOSSES_MEDICINE_DEVICE] ({commit},options) { //盘亏分析-医疗设备
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.LOSSES_MEDICINE_DEVICE, res.data.data )
        }
      })
  },
  [types.DEPARTMENT_PROFIT_ANALYSIS] ({commit},options){ //盘盈分析-科室盘盈分析
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if (res.data && res.data.success) {
          commit(types.DEPARTMENT_PROFIT_ANALYSIS, res.data.data)
        }
      })
  },
  [types.LOSSES_USEAGE] ({commit},options) { //盘亏分析-盘亏设备使用年限分析
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.LOSSES_USEAGE, res.data.data )
        }
      })
  },
  [types.PROFIT_BRAND_DEVICE] ({commit},options) { //盘亏分析-盘盈品牌分析
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.PROFIT_BRAND_DEVICE, res.data.data )
        }
      })
  },
  [types.LOSSES_BRAND_DEVICE] ({commit},options) { //盘亏分析-盘亏品牌分析
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.LOSSES_BRAND_DEVICE, res.data.data )
        }
      })
  },



  //第四章: 管理问题与建议
  [types.MANAGE_ADVISE] ({commit},options) { // 管理问题与建议
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.MANAGE_ADVISE, res.data.data )
        }
      })
  },

  //第五章: 附录
  [types.DEFINITION_CONCEPT] ({commit},options) { // 定义&概念
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.DEFINITION_CONCEPT, res.data.data )
        }
      })
  },
  [types.CATEGORY_APPRAISEMENT] ({commit},options) { // 各品类设备估值
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.CATEGORY_APPRAISEMENT, res.data.data )
        }
      })
  },



  [types.CURRENT_MONTH_REPAIR] ({commit},options) {
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.CURRENT_MONTH_REPAIR, res.data.data )
        }
      })
  },
  [types.CURRENT_MONTH_DEVICE] ({commit},options) {
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.CURRENT_MONTH_DEVICE, res.data.data )
        }
      })
  },


  [types.PAGE_DIRECTORY] ({commit},options) {
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.PAGE_DIRECTORY, res.data.data )
        }
      })
  },


  //第六章: 维修
  [types.REPAIR_BASE_CASE] ({commit},options) { // 管理问题与建议
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.REPAIR_BASE_CASE, res.data.data )
        }
      })
  },
  [types.TIME_ANALYSIS] ({commit},options) { // 时间分析
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.TIME_ANALYSIS, res.data.data )
        }
      })
  },
  [types.DEPARTMENT_ANALYSIS] ({commit},options) { // 科室分析
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.DEPARTMENT_ANALYSIS, res.data.data )
        }
      })
  },
  [types.VALUE_REPAIR_ANALYSIS] ({commit},options) { // 价值维修分析
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.VALUE_REPAIR_ANALYSIS, res.data.data )
        }
      })
  },
  [types.USE_YEAR_ANALYSIS] ({commit},options) { // 使用年限分析
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.USE_YEAR_ANALYSIS, res.data.data )
        }
      })
  },
  [types.VARIETIES_REPAIR_ANALYSIS] ({commit},options) { // 品类维修分析
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.VARIETIES_REPAIR_ANALYSIS, res.data.data )
        }
      })
  },
  [types.KEY_EQUIPMENT_REPAIR_ANALYSIS] ({commit},options) { // 重点设备维修分析
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.KEY_EQUIPMENT_REPAIR_ANALYSIS, res.data.data )
        }
      })
  },
  [types.EQUIPMENT_REPAIR_BRAND_ANALYSIS] ({commit},options) { // 重点设备维修品牌分析
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.EQUIPMENT_REPAIR_BRAND_ANALYSIS, res.data.data )
        }
      })
  },
  [types.EQUIPMENT_REPAIR_TICKS_ANALYSIS] ({commit},options) { // 重点设备维修工单分析
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.EQUIPMENT_REPAIR_TICKS_ANALYSIS, res.data.data )
        }
      })
  },
  [types.EQUIPMENT_ERROR_ANALYSIS] ({commit},options) { // 重点设备故障原因分析
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.EQUIPMENT_ERROR_ANALYSIS, res.data.data )
        }
      })
  },
  [types.LIFE_EQUIP_REPAIR_TIME_ANALYSIS] ({commit},options) { // 生命支持类设备维修时间分析
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.LIFE_EQUIP_REPAIR_TIME_ANALYSIS, res.data.data )
        }
      })
  },
  [types.LIFE_EQUIP_REPAIR_BRAND_ANALYSIS] ({commit},options) { // 生命支持类设备维修品牌分析
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.LIFE_EQUIP_REPAIR_BRAND_ANALYSIS, res.data.data )
        }
      })
  },
  [types.LIFE_EQUIP_REPAIR_CATEGORY_ANALYSIS] ({commit},options) { // 生命支持类设备维修品类分析
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.LIFE_EQUIP_REPAIR_CATEGORY_ANALYSIS, res.data.data )
        }
      })
  },
  [types.LIFE_EQUIP_ERROR_ANALYSIS] ({commit},options) { // 生命支持类设备故障原因分析
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.LIFE_EQUIP_ERROR_ANALYSIS, res.data.data )
        }
      })
  },
  [types.WORKER_WORKLOAD_COUNT] ({commit},options) { // 医工工作量统计
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.WORKER_WORKLOAD_COUNT, res.data.data )
        }
      })
  },
  [types.WORKER_RESPONSE_TIME] ({commit},options) { // 医工响应及维修时长
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.WORKER_RESPONSE_TIME, res.data.data )
        }
      })
  },
  [types.H_HOME_PAGE] ({commit},options) { // 横向首页
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    console.log('xxxxx: ' + url +'base :' + axios.defaults.baseURL)
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.H_HOME_PAGE, res.data.data )
        }
      })
  },
  [types.H_INFO_STRUCTURE] ({commit},options) { // 横向信息建筑分布
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.H_INFO_STRUCTURE, res.data.data )
        }
      })
  },
  [types.H_KEYNOTE_DEVICE] ({commit},options) { // 横向设备特征-重点设备分析
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.H_KEYNOTE_DEVICE, res.data.data )
        }
      })
  },
  [types.H_DEPARTMENT_BRAND] ({commit},options) { // 科室多维-品牌分析
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.H_DEPARTMENT_BRAND, res.data.data )
        }
      })
  },
  [types.H_DEPARTMENT_CATEGORY] ({commit},options) { // 科室多维-品类分析
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.H_DEPARTMENT_CATEGORY, res.data.data )
        }
      })
  },
  [types.H_DEPARTMENT_VALUE] ({commit},options) { // 科室多维-价值分析
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.H_DEPARTMENT_VALUE, res.data.data )
        }
      })
  },
  [types.H_INFO_DEPARTMENT] ({commit},options) { // 信息总览科室分布
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.H_INFO_DEPARTMENT, res.data.data )
        }
      })
  },
  [types.H_WORKER_WORKLOAD] ({commit},options) { // 医工统计-工作量统计
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        console.log(res.data)
        if(res.data && res.data.success){
          commit(types.H_WORKER_WORKLOAD, res.data.data )
        }
      })
  },
  [types.H_INFO_BASIC] ({commit},options) { // 信息总览-基本信息
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        console.log(res.data)
        if(res.data && res.data.success){
          commit(types.H_INFO_BASIC, res.data.data )
        }
      })
  },
  [types.H_REPAIR_VALUE] ({commit},options) { // 维修概况-价值维修
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        console.log(res.data)
        if(res.data && res.data.success){
          commit(types.H_REPAIR_VALUE, res.data.data )
        }
      })
  },
  [types.H_SECONDMENT_CATEGORY] ({commit},options) { // 借调情况-品类借调
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        console.log(res.data)
        if(res.data && res.data.success){
          commit(types.H_SECONDMENT_CATEGORY, res.data.data )
        }
      })
  },
  [types.H_SECONDMENT_DEPARTMENT] ({commit},options) { // 借调情况-科室借调
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        console.log(res.data)
        if(res.data && res.data.success){
          commit(types.H_SECONDMENT_DEPARTMENT, res.data.data )
        }
      })
  },
  [types.H_INFO_BRAND] ({commit},options) { // 信息总览-品牌分布
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        console.log(res.data)
        if(res.data && res.data.success){
          commit(types.H_INFO_BRAND, res.data.data )
        }
      })
  },
  [types.H_REPAIR_BARND] ({commit},options) { // 维修概况-维修品牌
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        console.log(res.data)
        if(res.data && res.data.success){
          commit(types.H_REPAIR_BARND, res.data.data )
        }
      })
  },
  [types.H_REPAIR_BASIC] ({commit},options) { // 维修概况-基本信息
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        console.log(res.data)
        if(res.data && res.data.success){
          commit(types.H_REPAIR_BASIC, res.data.data )
        }
      })
  },
  [types.H_END_PAGE] ({commit},options) { // 横向尾页封面
    let url = `?hosId=${options.hospitalID}&page=${options.moduleID}&style=${options.style}`;
    return axios.get(url)
      .then((res) => {
        if(res.data && res.data.success){
          commit(types.H_END_PAGE, res.data.data )
        }
      })
  },
}
export default actions
